The present invention relates to a disk cache system having a disk controller with a disk cache buffer.
A disk cache system generally adopts at least one of the store-in mode and the store-through mode. In the store-in mode, data is written in only a disk cache buffer in response to a write request into a disk unit. A write flag is set at an entry (an entry of a cache directory) corresponding to a block (block in a disk cache buffer) in which the data is written. The write flag indicates whether or not data of a corresponding block has been written in a disk unit. The data of the block corresponding to an entry (entry of the cache directory) having a set write flag is written in the disk unit utilizing the idle time of the disk controller. Upon data write in the disk unit, the write flag is reset. In contrast to this, in the store-through mode, data is simultaneously written in both a disk cache buffer and a disk unit in response to a write request into the disk unit. When a write request is generated, input/output end is obtained when data write into the disk cache buffer is ended in the store-in mode while it is obtained when data write into the disk unit is ended in the store-through mode.
In this manner, in the store-in mode, although the data writing to the disk can be performed to allow effective use of the disk cache buffer, write data on the disk cache buffer may not coincide with that at the corresponding area of the disk upon logical completion of the program. Furthermore, in the store-in mode, since the operation of the program and the write operation into the disk from the disk cache buffer are not synchronized with each other, when an error is generated (e.g., a CRC error, a seek error, etc.) during data write into the disk, error recovery by means of the program is hard to perform.
In contrast to this, although the program operation and the write operation into the disk can be synchronized in the store-in mode, the access time for data write cannot be shortened, so that the advantageous features of the disk cache buffer cannot be effectively used.